package com.yu.transfer;

import com.yu.service.RpcServiceProperties;
import lombok.*;

import java.io.Serializable;

/**
 * @PackageName: com.yu.transfer
 * @Description:
 * @Version: v1.0.0
 * @Author: yuweilin
 * @Date: 12:02
 * <p>
 * Modification History:
 * Date         Author          Version            Description
 * ------------------------------------------------------------
 * 2021/1/25      yuweilin         v1.0.0               新建
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ToString
public class RpcRequest implements Serializable {
    private static final long serialVersionUID = 1905122041950251207L;
    private String requestId;
    private String interfaceName;
    private String methodName;
    private Object[] parameters;
    private Class<?>[] paramTypes;
    private String version;
    private String group;

    public RpcServiceProperties toRpcProperties(){
        return RpcServiceProperties.builder().serviceName(this.getInterfaceName()).group(this.getGroup())
                .version(this.getVersion()).build();
    }
}
